﻿<Window x:Class="Scrabble.Views.MainView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:cal="clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro" WindowStartupLocation="CenterScreen"
        Height="300" Width="300" MinWidth="1200" MinHeight="750" Icon="/application.ico" >
    <Window.Resources>
        <ResourceDictionary Source="/Themes/Generic.xaml" />
    </Window.Resources>
    <DockPanel>
        <Menu DockPanel.Dock="Top">
            <MenuItem Header="_Game" >
                <MenuItem Name="NewGame" Header="_New" InputGestureText="F2" />
                <MenuItem Name="OpenGame" Header="_Open..." InputGestureText="Ctrl+O" />
                <Separator/>
                <MenuItem Name="SelectPlayers" Header="Select _Players..." />
                <Separator/>
                <MenuItem Name="SaveGame" Header="_Save" InputGestureText="Ctrl+S" />
                <MenuItem Name="SaveGameAs" Header="Save As..." />
                <Separator/>
                <MenuItem Name="Exit" Header="E_xit" InputGestureText="Atl+F4" />
            </MenuItem>
        </Menu>
        <DockPanel DockPanel.Dock="Top">
            <ToolBarTray DockPanel.Dock="Left">
                <ToolBar>
                    <ToolBar.Resources>
                        <Style TargetType="Image">
                            <Setter Property="Height" Value="16" />
                        </Style>
                    </ToolBar.Resources>
                    <Button cal:Message.Attach="NewGame" ToolTip="New (F2)">
                        <StackPanel Orientation="Horizontal">
                            <Image Source="/Assets/new.png" />
                        </StackPanel>
                    </Button>
                    <Button cal:Message.Attach="OpenGame" ToolTip="Open (Ctrl+O)">
                        <StackPanel Orientation="Horizontal">
                            <Image Source="/Assets/open.png" />
                        </StackPanel>
                    </Button>
                    <Button cal:Message.Attach="SaveGame" ToolTip="Save (Ctrl+S)" Style="{StaticResource ToolButtonStyle}">
                        <Image Source="/Assets/save.png" />
                    </Button>
                </ToolBar>
            </ToolBarTray>

            <StatusBar>
                <StatusBar.ItemsPanel>
                    <ItemsPanelTemplate>
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="4*"/>
                                <ColumnDefinition Width="80"/>
                                <ColumnDefinition Width="4"/>
                            </Grid.ColumnDefinitions>
                        </Grid>
                    </ItemsPanelTemplate>
                </StatusBar.ItemsPanel>
                <StatusBarItem />
                <StatusBarItem Grid.Column="1" HorizontalAlignment="Right" >
                    <StackPanel Orientation="Horizontal">
                        <Separator />
                        <Image Source="/Assets/stopwatch.png" Height="16" Margin="4,0,4,0" />
                        <TextBlock Text="{Binding Path=Game.Stopwatch.TotalRunningTime, StringFormat=hh\\:mm\\:ss}" MinWidth="60" />
                    </StackPanel>
                </StatusBarItem>
            </StatusBar>
        </DockPanel>

        <Grid Background="DarkGreen">
            <ContentControl x:Name="Game" />
        </Grid>
    </DockPanel>
</Window>
